﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EOS.Framework.Kernel;

namespace EOS.Framework.Web.Mvc
{
    public class WebPart : Container, IWebPart
    {
        private bool _enable = true;

        public bool Enable
        {
            get { return _enable; }
            set { _enable = value; }
        }

        public void Execute(IXhtmlWriter writer, PageContext pageContext)
        {
            Context = pageContext;

            if (_enable)
            {
                BeginRequest();
            }
            if (_enable)
            {
                BeginRender();
            }

            if (_enable)
            {
                Markup.RenderMarkup(writer, Context);
            }
        }
    }
}
